package com.yimi.appstore.db.dao;

import com.yimi.appstore.db.EntityBase;

public class DownloadRecordEntity implements EntityBase {

	public String getCreateTableSql() {
		String sql ="CREATE TABLE " + DOWNLOADS_TABLE_NAME + " ("
                + DownloadRecordEntity._ID + " INTEGER PRIMARY KEY AUTOINCREMENT,"
                + DownloadRecordEntity.RESOURCE_ID + " NVARCHAR(30),"
                + DownloadRecordEntity.URL + " NVARCHAR(500)  NOT NULL,"
                + DownloadRecordEntity.MIME_TYPE + " INTEGER,"
                + DownloadRecordEntity.FILE_NAME + " NVARCHAR(50)  NOT NULL,"
                + DownloadRecordEntity.LOCAL_PATH + " NVARCHAR(250)  NOT NULL,"
                + DownloadRecordEntity.MEDIA_URI + " NVARCHAR(250)  NULL,"
                + DownloadRecordEntity.LASTMOD + " LONG DEFAULT '-1' NOT NULL,"
                + DownloadRecordEntity.TOTAL_BYTES + " INTEGER  DEFAULT '-1' NOT NULL,"
                + DownloadRecordEntity.CURRENT_BYTES + " INTEGER  DEFAULT '0' NOT NULL,"
                + DownloadRecordEntity.ICON_NAME + " NVARCHAR(50),"
                + DownloadRecordEntity.STATUS + " INTEGER"
                + " )";
		return sql;
	}

	public String[] getInitTableSql() {
		 
		return null;
	}

	public String[] getUpdateTableSql() {
		
		return null;
	}

	/**下载记录表 表名*/
	public static final String DOWNLOADS_TABLE_NAME = "downloads";
	/**自增id 主键  INTEGER 非空*/
	public static final String _ID="_id"; 
	/**被下载的资源id NVARCHAR(30) 可空 */
	public static final String RESOURCE_ID="resource_id";
	/**被下载的资源url NVARCHAR(500) 非空*/
	public static final String URL = "url";
	/**被下载的资源扫描入库后的uri NVARCHAR(250) 可空*/
	public static final String MEDIA_URI="media_uri";
	/**被下载的资源类型 INTEGER 非空  1：应用 2：音乐 3:视频 4：小说*/
	public static final String MIME_TYPE="mime_type";
	/**被下载的资源的文件名称 NVARCHAR(50)  非空  */
	public static final String FILE_NAME = "file_name";
	/**被下载的资源的本地保存完整决定路径   NVARCHAR(250) 非空  */
	public static final String LOCAL_PATH = "local_path";
	/**被下载的资源 中 修改进度的最后时间 LONG  非空  初始默认值： -1：未修改过   单位毫秒*/
	public static final String LASTMOD = "lastmod";
	/**被下载的资源总字节数 INTEGER 非空 初始默认值：-1  未启动下载任务 */
	public static final String TOTAL_BYTES = "total_bytes";
	/**被下载的资源当前已经下载的字节数 INTEGER 非空 初始默认值：0  未启动下载任务 */
	public static final String CURRENT_BYTES = "current_bytes";
	/**被下载资源的图标文件名字 NVARCHAR(50) */
	public static final String ICON_NAME="icon_name";
	/**被下载资源的下载状态 INTEGER*/
	public static final String STATUS="status";
}
